#ifndef MODBUSTCPDIALOG_H
#define MODBUSTCPDIALOG_H

#include <QWidget>
#include <QModbusTcpClient>
#include <QModbusDataUnit>
#include <QModbusReply>
#include <QDebug>
#include <QUrl>
#include <QVector>
#include <QTest>
#include <QMessageBox>
#include "mythread.h"

namespace Ui {
class ModbusTcpDialog;
}

class ModbusTcpDialog : public QWidget
{
    Q_OBJECT

public:
    explicit ModbusTcpDialog(QWidget *parent = nullptr);
    ~ModbusTcpDialog();

private:
    Ui::ModbusTcpDialog *ui;

    QVector<float> DATA;
    bool TYPE;
    QString IP_address;
    QThread* t;
    MyThread* mythread;
    QString TOKEN;
    QString SaveFloder;
    bool close_type = false ;

private slots:
    void on_AllPushButton_clicked();

    void on_SimplePushButton_clicked();
    void initAllPath();

    void saveTokenAndFloder(QString,QString);
    void finishThread();
    void UploadErrorInfo(QString);

    void on_stopButton_clicked();

public slots:

      void reciveMod(QVector<float>,QString);


signals:
      void Connect_to_modbus_All(QString,bool,QString,QString);
      void Connect_to_modbus_Simple(QString,bool,QString,QString);

};

#endif // MODBUSTCPDIALOG_H
